
<%@ page import="books4africa.Books" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'books.label', default: 'Books')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#show-books" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="show-books" class="content scaffold-show" role="main">
			<h1><g:message code="default.show.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list books">
			
				<g:if test="${booksInstance?.title}">
				<li class="fieldcontain">
					<span id="title-label" class="property-label"><g:message code="books.title.label" default="Title" /></span>
					
						<span class="property-value" aria-labelledby="title-label"><g:fieldValue bean="${booksInstance}" field="title"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.author}">
				<li class="fieldcontain">
					<span id="author-label" class="property-label"><g:message code="books.author.label" default="Author" /></span>
					
						<span class="property-value" aria-labelledby="author-label"><g:fieldValue bean="${booksInstance}" field="author"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.isbn}">
				<li class="fieldcontain">
					<span id="isbn-label" class="property-label"><g:message code="books.isbn.label" default="Isbn" /></span>
					
						<span class="property-value" aria-labelledby="isbn-label"><g:fieldValue bean="${booksInstance}" field="isbn"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.description}">
				<li class="fieldcontain">
					<span id="description-label" class="property-label"><g:message code="books.description.label" default="Description" /></span>
					
						<span class="property-value" aria-labelledby="description-label"><g:fieldValue bean="${booksInstance}" field="description"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.category}">
				<li class="fieldcontain">
					<span id="category-label" class="property-label"><g:message code="books.category.label" default="Category" /></span>
					
						<span class="property-value" aria-labelledby="category-label"><g:fieldValue bean="${booksInstance}" field="category"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.minGradeLevel}">
				<li class="fieldcontain">
					<span id="minGradeLevel-label" class="property-label"><g:message code="books.minGradeLevel.label" default="Min Grade Level" /></span>
					
						<span class="property-value" aria-labelledby="minGradeLevel-label"><g:fieldValue bean="${booksInstance}" field="minGradeLevel"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.maxGradeLevel}">
				<li class="fieldcontain">
					<span id="maxGradeLevel-label" class="property-label"><g:message code="books.maxGradeLevel.label" default="Max Grade Level" /></span>
					
						<span class="property-value" aria-labelledby="maxGradeLevel-label"><g:fieldValue bean="${booksInstance}" field="maxGradeLevel"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.donation}">
				<li class="fieldcontain">
					<span id="donation-label" class="property-label"><g:message code="books.donation.label" default="Donation" /></span>
					
						<g:each in="${booksInstance.donation}" var="d">
						<span class="property-value" aria-labelledby="donation-label"><g:link controller="donation" action="show" id="${d.id}">${d?.encodeAsHTML()}</g:link></span>
						</g:each>
					
				</li>
				</g:if>
			
				<g:if test="${booksInstance?.edition}">
				<li class="fieldcontain">
					<span id="edition-label" class="property-label"><g:message code="books.edition.label" default="Edition" /></span>
					
						<span class="property-value" aria-labelledby="edition-label"><g:fieldValue bean="${booksInstance}" field="edition"/></span>
					
				</li>
				</g:if>
				<g:if test="${booksInstance?.id }">
				<li class="fieldcontain">
                              <span id="ranks-label" class="property-label"><g:message code="books.ranks.label" default="Ranks" /></span>
                              <span class="property-value">
                              <g:if test="${booksInstance?.ranks}">
                              <g:link controller="Ranking" action="show" params="[bookId: booksInstance?.id]">View Rankings</g:link>
                              </g:if>
                              <g:else>
                              <g:link controller="Ranking" action="show" params="[bookId: booksInstance?.id]">Add Ranking</g:link>
                              </g:else>
                              
                              </span>
                        </li>
				</g:if>
			
			</ol>
			<g:form>
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${booksInstance?.id}" />
					<g:link class="edit" action="edit" id="${booksInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
				
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
